import { Http } from "@/utils/request";
import { Toast } from "@/utils/toast";
import { delayTask } from "@/utils/timer";

const baseUrl = "/guider_star";

export const index_api = (data: MiniApp.PagingQuery, showError = true) => {
  return Http.get<MiniApp.PagingData>(`/v3${baseUrl}/index`, data).catch(
    (error: Error) => {
      showError && delayTask(60, () => Toast.show(error.message));
      return Promise.reject(error);
    }
  );
};
